<template>
  <div>
    <div class="main">
      <TitleComponent/>
    </div>
    <div class="content">
      <h2>{{ list.title }}</h2>
      <p class="time">{{list.sendTime}}</p>
      <div v-html="list.content"></div>
    </div>
    <Friend/>
  </div>
</template>

<script>
import TitleComponent from "@/views/Index/components/TitleComponent";
import {getArticleText} from "@/api/index-api";
import Friend from "@/components/Friend";

export default {
  name: "ArticleDetail",
  data() {
    return {
      list: ''
    }
  },
  components: {
    TitleComponent,
    Friend
  },
  created() {
    console.log(this.$route.query.articleId)
    getArticleText(this.$route.query.articleId).then(res => {
      this.list = res.data
      console.log(this.list)
    })
  }
}
</script>

<style scoped lang="less">
.main {
  background-color: white;

}

.content {
  border: 1px solid #f1f1f1;
  width: 1200px;
  margin: 20px auto;
  background-color: white;

  h2 {
    text-align: center;

  }
  p.time{
    text-align: center;
    color: #999;
  }
}
</style>